package com.example.myapplication.model.entity;

import androidx.annotation.NonNull;
import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

import com.example.myapplication.BR;
@Entity
public class User extends BaseObservable {

    @PrimaryKey
    @NonNull
    @ColumnInfo(name = "u_name")
    @Bindable
    private String name;

    @ColumnInfo(name = "u_age")
    @Bindable
    private int age;

    @ColumnInfo(name = "u_sex")
    @Bindable
    private boolean sex;

    public User(){

    }

    public User(@NonNull String name, int age, boolean sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
        notifyPropertyChanged(BR.name);
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
        notifyPropertyChanged(BR.age);
    }

    public boolean isSex() {
        return sex;
    }

    public void setSex(boolean sex) {
        this.sex = sex;
        notifyPropertyChanged(BR.sex);
    }

}

